#ifndef POLYFIT_H_
#define POLYFIT_H_

#ifdef __cplusplus
extern "C" {
#endif
typedef struct Line_polyfit_t
{
    double*         x;
	double*         y;
	unsigned int    size;
	unsigned int    order;
	double*         result;
}Line_polyfit_t;


int polyfit(const double* const dependentValues,
            const double* const independentValues,
            unsigned int        countOfElements,
            unsigned int        order,
            double*             coefficients);

double polyeval(const double dependantValue, unsigned int order, double* coefficients);

#define Line_Polyfit(pf)    polyfit(pf.x, pf.y, pf.size, pf.order, pf.result)
#define Line_Polyeval(pf,x) polyeval(x, pf.order, pf.result)

#ifdef __cplusplus
}
#endif

#endif
